<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="cn.ac.cintcm.dataconverge.researcher.domain.Researcher,
java.util.*,com.hs.core.page.PageUtil,com.hs.core.utils.*,cn.ac.cintcm.dataconverge.util.Constants" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";

PageUtil pageUtil = (PageUtil)request.getAttribute("pageUtil");
int perpageCount = 1;
int currentPage = 1;
List list = null;
String pageStr = "";
if(null != pageUtil){
	list = pageUtil.getPageList();
   pageStr = pageUtil.getPageStr();
   perpageCount = pageUtil.getNumberPerPage();
   currentPage = pageUtil.getCurrentPage();
}
String orderName = (String)request.getAttribute("orderName");
String orderNum = (String)request.getAttribute("orderNum"); 
%><html>
  <head>
  	<TITLE>科研人员管理</TITLE>
   <link href="<%=basePath%>index/Themes/com/style.css" rel="stylesheet" type="text/css" />
    <script src="<%=basePath%>index/Scripts/Script.js" language="javascript" type="text/javascript"></script>
     <script src="<%=basePath%>js/common.js" language="javascript" type="text/javascript"></script>
    
	<SCRIPT type="text/javascript">
	function modifyUser(value) {
	        //var bln = window.confirm("确定要修改吗？", "确定", "取消");
	        //if(bln == true) {
//	        var page=document.all.ec_p.value;
 			var page = 5;
			url = "expert.htm?action=expertModify&flag=mod&ids=" + value;
			openwindow(url,'700','600','');
			//}
		}
	
	function deleteUser(value) {
		var bln = window.confirm("确定要删除此专家吗？", "确定", "取消");
		if(bln == true) { 
			url = "expert.htm?action=delExpert&ids=" + value; 
			form1.action=url;
			searchform.submit();
		}
	}
	</SCRIPT>
</head>
  
 <body  scroll="yes">
      <div class="r_rtm_tb_mg1">
        <div class="r_rtm_tb1">
            <img src="<%=basePath%>index/Themes/com/idt_tb_pass.gif" />&nbsp;专家管理
        </div>
    </div>
     <table cellspacing="2" cellpadding="0" width="100%" class="idt_item_mg" id="Table2">
     <tbody><form name="searchform" action="<%=path %>/expert.htm?action=list" method="post">
        <tr>
		 
         <td class="fim_l">姓名:</td>
            <td class="fim_r" colspan="3">
               <input type="text" class="com_textbox" id="name" name="name" value="<%=StringUtilTool.setObjNULLStr(request.getAttribute("name")) %>"></td>
            <td class="fim_r" align="right" nowrap="nowrap" colspan="4">
                <input type="submit" value="查询" name="B3" class="com_btn2" id="Button5">
                 <!-- <input type="button" value="高级查询" name="B3" onclick="if(AdCheckForm.style.display=='none')AdCheckForm.style.display='';else AdCheckForm.style.display='none';"
                    class="com_btn2" id="Button1"-->
                <input type="button" value="添加" name="B4" class="com_btn2" id="Button2" onclick="javascript:openwindow('<%=path %>/expert.htm?action=addExpert','800','600','');">
			
            </td>
        </tr>
          <tr id="AdCheckForm" style="display: none;">
           <td class="fim_l">用户组:</td>
          	<td class="fim_r">
             <input type="text" class="com_textbox" id="groupname" name="groupname" value="<%=StringUtilTool.setObjNULLStr(request.getAttribute("groupname")) %>"></td>
       
            <td class="fim_l">
               单位：</td>
            <td class="fim_r">
                <input type="text" class="com_textbox" id="nameOrg" name="nameOrg" value="<%=StringUtilTool.setObjNULLStr(request.getAttribute("nameOrg")) %>"></td>
            <td class="fim_l">
                部门：</td>
            <td class="fim_r">
             <input type="text" class="com_textbox" id="nameDep" name="nameDep" value="<%=StringUtilTool.setObjNULLStr(request.getAttribute("nameDep")) %>"></td>
            <td class="fim_l">
                  身份证号：</td>
            <td class="fim_r" >
                <input type="text" class="com_textbox" id="ids" name="ids" value="<%=StringUtilTool.setObjNULLStr(request.getAttribute("ids")) %>"></td>
        </tr>
        </form></tbody>
    </table>
    <div class="content">
        <table width="*" cellpadding="0" cellspacing="1" class="dg_borderstyle" id="Table4" >
            <tr>
                <td class="dg_headerstyle">
                    序号</td>  
                 <td class="dg_headerstyle" ><a href="javaScript:orderPage('ida','<%=OrderTool.getOrderNum("ida",orderName,orderNum)%>');">专家帐号&nbsp;&nbsp;<%=OrderTool.getOrderImage(basePath,OrderTool.getOrderNum("ida",orderName,orderNum))%></a></td>
                <td class="dg_headerstyle">
                 <a href="javaScript:orderPage('name','<%=OrderTool.getOrderNum("name",orderName,orderNum)%>');">专家姓名&nbsp;&nbsp;<%=OrderTool.getOrderImage(basePath,OrderTool.getOrderNum("name",orderName,orderNum))%></a></td>
                   
                      <td class="dg_headerstyle">
                  单位
                     </td>
                    
                      <td class="dg_headerstyle">
                  部门
                     </td>
                    
                      <td class="dg_headerstyle">
                  学科角色
                    </td>
                    
                      <td class="dg_headerstyle">
                 身份证号
                    </td>
                <td class="dg_headerstyle">编辑</td>
                 <td class="dg_headerstyle">删除</td>
            </tr>
            <% 
            if(list != null && list.size()>0){
	            Iterator iterator = list.iterator(); 
	            int i=0;
	            while(iterator.hasNext()){
	            	Researcher researcher = (Researcher)iterator.next();
	            	i++;
            %>
            <tr class="dg_alternatingitemstyle" onmouseover="ChangeRowBg(this);" onmouseout="ChangeRowBg(this);" onmouseup="ChangeRowBg(this);" onmousedown="ChangeRowBg(this);">
                <td align="center">
                    <%= perpageCount*(currentPage-1)+i %></td> 
                    <td>
                     <%=researcher.getIda() %>
                </td>
                <td>
                     <%=researcher.getName() %>
                </td>
                
                  
                
                   <td>
                     <%if(researcher.getOrg() != null)out.print(researcher.getOrg().getName()); %>
                </td>
                
                   <td>
                     <%if(researcher.getDepartment() != null)out.print(researcher.getDepartment().getName()); %>
                </td>
                
                   <td>
                     <%=Constants.getPosition(researcher.getPosition())%>
                </td>
                
                   <td>
                     <%=StringUtilTool.setObjNULLStr(researcher.getIdcard()) %>
                </td>
                <td align="center">
                <img style="cursor: hand" src="<%=basePath%>index/Themes/com/68design.net_registration1_(edit)_16x16.gif" onclick="javascript:modifyUser('<%=researcher.getIds() %>');"
                                    alt="编辑" />
                <td align="center"><img style="cursor: hand" src="<%=basePath%>index/Themes/com/68design.net_registration1_(delete)_16x16.gif" onclick="javascript:deleteUser('<%=researcher.getIds() %>');"
               alt="删除" />
                </td>
            </tr>
            <%}}else{ %>
            <tr class="dg_alternatingitemstyle">
                 <td colspan="9" align="center"><font color="red">没有记录</font></td>
            </tr> 
            <%} %>
        </table>
        <div class="dg_pagerstyle" align="right">
        	<%=pageUtil.getPageStr()%>
        </div>
    </div>
  </body>
</html>
